package com.column;

import java.io.File;

public class Main55 {
    public static void main(String[] argv) throws Exception{
        System.out.println("遍历目录");
        File dir=new File("/www/java");
        visitAllDirsAndFiles(dir);
    }
    public static void visitAllDirsAndFiles(File dir){
        System.out.println(dir);
        if(dir.isDirectory()){
            for(String child:dir.list()){
                visitAllDirsAndFiles(new File(dir,child));
            }
        }
    }
}
